	cd("C:/Users/eas24f/OneDrive - Florida State University/Research/Inertia RESTAT/Data")
	
	# Packages
		# To install: using Pkg
		# Then Pkg.add("package_name")
		# NOTE: I'm not sure we need all of these packages
		
		using DataFrames
		using StatsBase
		using Optim
		using Calculus
		using Distributions
		using NLsolve
		using ForwardDiff
		using Random
		using DelimitedFiles
		using CSV
		using LinearAlgebra
		
	if network_flag

		# Household-plan level data (includes premium, choice, previous choice, 
			# cost factors, pricing factors, etc.) 
		data = CSV.read("ca_julia_supply_data_JUN182021_net.csv", DataFrame, header=true); 
		
		# Household-level data (income, age, etc.)
		households = CSV.read("ca_household_characteristics_JUN182021_net.csv", DataFrame, header = true);
		
		# Plan characteristic data w/o CSR plans
		plans = CSV.read("ca_plan_year_JUN182021_net.csv", DataFrame, header = true);
		plans_pmt = CSV.read("ca_plan_market_year_JUN182021_net.csv", DataFrame, header = true);
		
		# Load Choice Set Data
		unique_choice_sets = CSV.read("unique_choice_sets_JUN182021_net.csv", DataFrame,header = true);	
		
		# Demand parameter estimates
		param_estimates = CSV.read("demand_parameter_estimates.csv", DataFrame, header=true); # parameters from demand estimation
		param_estimates = dropmissing(param_estimates,:Network);
		min_beta = param_estimates[!,:Network];
		
		# Data for average claims, risk score, and predicted cost moments 
		moments_data = CSV.read("moments_data_net.csv", DataFrame, header=true);
		rs_estimates = CSV.read(string("rs_coefficients_intermediate_avint_net.csv"), DataFrame, header=true);

	elseif eq_robust_flag
		
		# Household-plan level data (includes premium, choice, previous choice, 
			# cost factors, pricing factors, etc.) 
		data = CSV.read("ca_julia_supply_data_JUN262020_learn.csv", DataFrame,  header=true); 
		
		# Household-level data (income, age, etc.)
		households = CSV.read("ca_household_characteristics_AUG032019_small.csv", DataFrame,  header = true);
		
		# Plan characteristic data w/o CSR plans
		plans = CSV.read("ca_plan_year_JUN262020_learn.csv", DataFrame,  header = true);
		plans_pmt = CSV.read("ca_plan_market_year_JUN262020_learn.csv", DataFrame, header = true);
		
		# Load Choice Set Data
		unique_choice_sets = CSV.read("unique_choice_sets_MAY112021.csv", DataFrame,header = true);	
		
		# Demand parameter estimates
		param_estimates = CSV.read("demand_parameter_estimates.csv", DataFrame,  header=true); # parameters from demand estimation
		param_estimates = dropmissing(param_estimates,:Robust);
		min_beta = param_estimates[!,:Robust];
		
		# Data for average claims, risk score, and predicted cost moments 
		moments_data = CSV.read("moments_data_robust.csv", DataFrame,  header=true);
		rs_estimates = CSV.read(string("rs_coefficients_intermediate_avint_eqrobust.csv"), DataFrame, header=true);

	elseif inattention
	
		# Household-plan level data (includes premium, choice, previous choice, 
			# cost factors, pricing factors, etc.) 
		data = CSV.read("ca_julia_supply_data_JUN262020_learn.csv", DataFrame,  header=true); 
		
		# Household-level data (income, age, etc.)
		households = CSV.read("ca_household_characteristics_AUG032019_small.csv", DataFrame,  header = true);
		
		# Plan characteristic data w/o CSR plans
		plans = CSV.read("ca_plan_year_JUN262020_learn.csv", DataFrame,  header = true);
		plans_pmt = CSV.read("ca_plan_market_year_JUN262020_learn.csv", DataFrame, header = true);
		
		# Load Choice Set Data
		unique_choice_sets = CSV.read("unique_choice_sets_MAY112021.csv", DataFrame,header = true);	
		
		# Demand parameter estimates
		param_estimates = CSV.read("demand_parameter_estimates.csv", DataFrame,  header=true); # parameters from demand estimation
		param_estimates = dropmissing(param_estimates,:Inattention);
		betap = param_estimates[!,:Inattention];
		
		# Data for average claims, risk score, and predicted cost moments 
		moments_data = CSV.read("moments_data_inattention.csv", DataFrame,  header=true);
		rs_estimates = CSV.read(string("rs_coefficients_intermediate_avint_inattention.csv"), DataFrame, header=true);

		
	else
		
		# Household-plan level data (includes premium, choice, previous choice, 
			# cost factors, pricing factors, etc.) 
		data = CSV.read("ca_julia_supply_data_JUN262020_learn.csv", DataFrame, header=true); 
		
		# Household-level data (income, age, etc.)
		households = CSV.read("ca_household_characteristics_AUG032019_small.csv", DataFrame, header = true);
		
		# Plan characteristic data w/o CSR plans
		plans = CSV.read("ca_plan_year_JUN262020_learn.csv", DataFrame, header = true);
		plans_pmt = CSV.read("ca_plan_market_year_JUN262020_learn.csv",DataFrame, header = true);
		
		# Load Choice Set Data
		unique_choice_sets = CSV.read("unique_choice_sets_MAY112021.csv", DataFrame,header = true);	
		
		# Demand parameter estimates
		param_estimates = CSV.read("demand_parameter_estimates.csv", DataFrame, header=true); # parameters from demand estimation
		if (choice_seq_flag & add_av_interactions)
			param_estimates = dropmissing(param_estimates,:AV_Seq_CF_Random_IMFE);
			min_beta = param_estimates[!,:AV_Seq_CF_Random_IMFE];
		elseif choice_seq_flag
			param_estimates = dropmissing(param_estimates,:Seq_CF_Random_IMFE);
			min_beta = param_estimates[!,:Seq_CF_Random_IMFE];
		elseif add_av_interactions
			param_estimates = dropmissing(param_estimates,:AV_CF_Random_IMFE);
			min_beta = param_estimates[!,:AV_CF_Random_IMFE];
		else
			param_estimates = dropmissing(param_estimates,:CF_Random_IMFE);
			min_beta = param_estimates[!,:CF_Random_IMFE];
		end
		
				
		# Data for average claims, risk score, and predicted cost moments 
		if (old_flag & av_rs_flag)
			moments_data = CSV.read("moments_data_old_av.csv", DataFrame, header=true);
		elseif old_flag 
			moments_data = CSV.read("moments_data_old.csv", DataFrame, header=true);
		elseif (int_rs_variables & av_rs_flag)
			moments_data = CSV.read("moments_data_int_av.csv", DataFrame, header=true);
		elseif (choice_seq_flag & int_rs_variables & add_av_interactions)
			moments_data = CSV.read("moments_data_int_seq_avint.csv", DataFrame, header=true);
		elseif (choice_seq_flag & int_rs_variables)
			moments_data = CSV.read("moments_data_int_seq.csv", DataFrame, header=true);
		elseif (int_rs_variables & add_av_interactions)
			moments_data = CSV.read("moments_data_int_avint.csv", DataFrame, header=true);
		elseif int_rs_variables 
			moments_data = CSV.read("moments_data_int.csv", DataFrame, header=true);
		elseif hisp_flag
			moments_data = CSV.read("moments_data_hisp.csv", DataFrame, header=true);
		elseif agegender_flag
			moments_data = CSV.read("moments_data_agegender.csv", DataFrame, header=true);
		elseif (all_rs_variables & choice_seq_flag & add_av_interactions)
			moments_data = CSV.read("moments_data_full_seq_avint.csv", DataFrame, header=true);
		elseif (all_rs_variables & add_av_interactions)
			moments_data = CSV.read("moments_data_full_avint.csv", DataFrame, header=true);
		elseif (all_rs_variables & choice_seq_flag & av_rs_flag)
			moments_data = CSV.read("moments_data_full_seq.csv", DataFrame, header=true);
		elseif (all_rs_variables & av_rs_flag)
			moments_data = CSV.read("moments_data_full_av.csv", DataFrame, header=true);
		else
			moments_data = CSV.read("moments_data_full.csv", DataFrame, header=true);
		end
		
		if (old_flag & av_rs_flag)
			rs_estimates = CSV.read(string("rs_reg_output_old_av.csv"),DataFrame, header=true);
		elseif old_flag	
			rs_estimates = CSV.read(string("rs_reg_output_old.csv"),DataFrame, header=true);
		elseif (int_rs_variables & av_rs_flag)
			rs_estimates = CSV.read(string("rs_reg_output_intermediate_av.csv"),DataFrame, header=true);
		elseif choice_seq_flag & int_rs_variables & add_av_interactions
			rs_estimates = CSV.read(string("rs_reg_output_intermediate_seq_avint.csv"),DataFrame, header=true);
		elseif choice_seq_flag & int_rs_variables
			rs_estimates = CSV.read(string("rs_reg_output_intermediate_seq.csv"),DataFrame, header=true);
		elseif (int_rs_variables & add_av_interactions)
			rs_estimates = CSV.read(string("rs_reg_output_intermediate_avint.csv"),DataFrame, header=true);
		elseif int_rs_variables
			rs_estimates = CSV.read(string("rs_reg_output_intermediate.csv"),DataFrame, header=true);
		elseif hisp_flag
			rs_estimates = CSV.read(string("rs_reg_output_intermediate_hisp.csv"),DataFrame, header=true);
		elseif agegender_flag
			rs_estimates = CSV.read(string("rs_reg_output_agegender.csv"),DataFrame, header=true);
		elseif (all_rs_variables & choice_seq_flag & add_av_interactions)
			rs_estimates = CSV.read(string("rs_reg_output_full_seq_avint.csv"),DataFrame, header=true);
		elseif (all_rs_variables & add_av_interactions)
			rs_estimates = CSV.read(string("rs_reg_output_full_avint.csv"),DataFrame, header=true);
		elseif (all_rs_variables & choice_seq_flag & av_rs_flag)
			rs_estimates = CSV.read(string("rs_reg_output_av.csv"),DataFrame, header=true);
		elseif (all_rs_variables & av_rs_flag)
			rs_estimates = CSV.read(string("rs_reg_output_av_noseq.csv"),DataFrame, header=true);
		elseif all_rs_variables
			rs_estimates = CSV.read(string("rs_reg_output_full.csv"),DataFrame, header=true);
		end
	end
	
	# Main functions that calculate terms in FOCs
	cd("C:/Users/eas24f/OneDrive - Florida State University/Research/Inertia RESTAT/Code")
	include("estimation.functions.jl");	
	Random.seed!(6);		
	cd("C:/Users/eas24f/OneDrive - Florida State University/Research/Inertia RESTAT/Data")
	